package action.admin.assignment;

import beans.Assignment;
import dao.MngAssignment;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class setMarkAssign extends HttpServlet {

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        try {
            String assign_id = request.getParameter("assign_id");
            String mark = request.getParameter("mark");         
            Assignment assign = new Assignment();
            assign.setAssign_id(assign_id);
            assign.setMark(mark);
            MngAssignment mngAssign = new MngAssignment();
            if (mngAssign.setMark(assign)) {
                request.setAttribute("class_id", request.getParameter("class_id"));
                RequestDispatcher rd = request.getRequestDispatcher("index.jsp?page=showassign");
                rd.forward(request, response);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
